<template>
	<view class="page">
	   <view  @click="go(item)" style="background: #fff;padding: 30rpx;" v-for="(item,index) in list " :key="index" class="u-border-bottom u-flex">
	   	<view>
	   		<u-image :src="item.cover" width="200" height="200" border-radius="30"></u-image>
	   	</view>
	   	<view class="u-margin-left-20 " style="width: 500rpx; height: 200rpx; display: flex;justify-content: space-between;flex-direction: column;">
	   		<view class="u-line-2 u-font-weight" style="">
	   			{{item.goodsName}}
	   		</view>
	   		<view class="u-flex u-row-between"  style="width: 450rpx; " >
	   			<view class="u-type-error">
	   				￥{{item.price}}
	   			</view>
	   			<view class="u-margin-left-20">
	   				<u-button size="mini"  @click.stop="call(item)"   type="primary" >
						<u-icon name="phone-fill"></u-icon>
						<text class="u-margin-left-10"></text>联系老板</u-button>
	   			</view>
	   		</view>
	   	</view>
	   
	   
	   
	   </view>
	</view>
</template>

<script>
	import loader from '@/common/loadPage.js';
	export default {
		mixins: [loader],
		data() {

			return {
				tabbar: [],
				nav: [],
				current: 0,
				list: [],
				initial: {
					geturl: "/index/goods",
					parm: {
					  
					  goods_classify_id:''
					},
					isPage: true
				},




			}
		},
		async onLoad(options) {
		if(options.id){
			this.initial.parm.goods_classify_id=options.id;
			this.getGoods()
		}
			
		},
		methods: {
			go(item){
				uni.navigateTo({
					url:'./detail?id='+item.id
				})
			},
			call(item) {
				this.$u.post('/user/contactGoods',{
					id:item.id
				}).then(res => {
					uni.makePhoneCall({
						phoneNumber:res
					})
				}).catch(err => {
				   
				})
			}
		}
	}
</script>


<style>
	.page {
		background: #F1F1F1;
		min-height: 100vh;
	}
	.list{
		background: #fff;
	    width:700rpx;
		 margin: 20rpx auto;
		 padding: 20rpx;
	}
</style>
